class_name Poison extends Effect

#var life:TimeType = TimeType.HIT#生命周期
#var effect_type:EffectType = EffectType.STACKABLE#叠加类型
#signal effect_end#效果结束时发出
#var cue_list:Array[Cue] = []# cue列表
#var AS:AbilitySystem# 当前的AbilitySystem

func in_effect(_target) -> void:
	self.AS = _target
	self.life = TimeType.TIMES
	self.effect_type = EffectType.SINGLE
	self.cue_list.append(GC_毒)
	effect_apply()
	
	

func effect_apply() -> void:
	self.create_cue()
	self.AS.change_hp(-100,"毒")
	var time = Timer.new()
	var time_life = Timer.new()
	self.AS.add_child(time)
	self.AS.add_child(time_life)
	time_life.wait_time = 10.0
	time_life.timeout.connect(end_effect)
	time.wait_time = 2.5
	time.timeout.connect(on_time_out.bind(time))
	time.start()
	time_life.start()
	pass

func on_time_out(time:Timer):
	self.AS.change_hp(-50,"毒")
	time.start()
	pass
